#ifndef _SHAPE_CONTAINER_H_
#define _SHAPE_CONTAINER_H_

#include<typeinfo.h>
#include "ScreenApp.h"
#include "Shape.h"
#include<math.h>
#include<list>
#include<string>

class ShapeContainer
{
	list<Shape*> m_shape_cont;

public:
	~ShapeContainer();
	void addShapeToList(Shape* shape);
	void drawList(bool withHiding);
	list<Shape*>::iterator findContainingShape(int x, int y);
	void copyContainer(ShapeContainer &other);
	void calcMove(bool withTransfer, ShapeContainer &work_cont);
	bool didIMove(list<Shape*>::iterator itr){return( (abs((*itr)->getShiftXTmp()) >= 1) || (abs((*itr)->getShiftYTmp()) >= 1) ) ;}
	void saveToFile(bool binary);
	void loadFromFile(bool binary);


	//list functions
	list<Shape*>::iterator getBeginningOfList(){ return m_shape_cont.begin(); }
	list<Shape*>::iterator getEndOfList(){ return m_shape_cont.end(); }
	list<Shape*> &getList(){ return m_shape_cont;}
	void bringToFront(list<Shape*>::iterator itr);
	void moveToBack(list<Shape*>::iterator itr);
	void deleteShape(list<Shape*>::iterator itr);
};

#endif